package com.atguigu.juc.interview.thread.local;

/**
 * @author leimingchao
 * @create 2024-03-04 20:12
 */
public class ThreadLocalTest {

    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    public static void main(String[] args) {


        Thread t1 = new Thread(() -> {
            System.out.println(threadLocal);
            threadLocal.set(1);
        });
        Thread t2 = new Thread(() -> {
            threadLocal.set(2);
            System.out.println(threadLocal);
        });

        t1.start();
        t2.start();
    }
}
